import React, { useEffect, useState } from 'react'

export default function App() {
  let [opacity, steOpacity] = useState(1)

  useEffect(() => {

    const timer = setInterval(() => {
      opacity -= 0.05
      if (opacity < 0) {
        opacity = 1
      }
      steOpacity(opacity)

      return () => {
        clearInterval(timer)
      }
    }, 100)

  }, [])



  return (
    <div>
      <h1 style={{ opacity }}>找不到工作怎么办</h1>
    </div>
  )
}
